from rest_framework.permissions import BasePermission

SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')


class IsSuperUser(BasePermission):
    """
    自定义对象权限，只允许项目的superuser查看所有列表
    """

    def has_permission(self, request, view):
        return bool(request.user and request.user.is_superuser)
